<template>
  <layout :config="navConfig">
    <template #default>
      <div class="m-share-box">
        <div class="title">推荐好友领福利</div>
        <div class="overBox">
          <div class="text">邀请码</div>
          <div class="code">{{code}}</div>
          <div class="info">您的好友在注册时也可填写邀请码</div>

          <div class="qrcode-box">
            <qr-code :margin="10" :text="qrCode"/>
          </div>
          <div class="saveText">长按保存二维码可分享</div>
        </div>
      </div>
    </template>
  </layout>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { INavigation } from "@/types";
import qrCode from "vue-qr";

@Component({
  name: "Share",
  components: {
    qrCode
  },
    created: function () {
        let usera = JSON.parse(localStorage.getItem('users1'));
        this.code=usera.username;
    }
})
export default class extends Vue {
  navConfig: INavigation = {
    text: "推广分享"
  };
  code="";
  qrCode = "http://www.baidu.com?search='5050'";
}
</script>

<style lang="scss">
@import "../assets/styles/share.scss";
</style>
